//************************************************************************
// author	:	vera												
// date		:	2011/7/21 22:11 
//************************************************************************
// CParser is used to parse the script file example shader information and
// teture source and so on

#ifndef Q_PARSER_H
#define Q_PARSER_H

// define the shader infomation

typedef struct Semantic
{
	char	*pName;
	char	*pValue;
	int		nIdx; // using for the collision between two same value 
} InfoParam;


typedef struct ShaderInfo
{
	char * pShaderName;

	char * pVertexSrc;
	char * pFragmentSrc;

	// the uniforms and attribs struct
	Semantic	*pUniforms;
	int		nUniformNum, nUniformMax;
	Semantic	*pAttribs;
	int		nAttribNum, nAttribMax;

} ShaderInfo;

class CParser
{
public:
	CParser(void);
	~CParser(void);

	bool ParseFromFile( const char * filename );
	bool ParseFromMemory( const char * const stream );

private:

	bool ParseShader();

};


#endif